package com.hbue.water.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hbue.water.entity.WaterDetails;
import com.hbue.water.mapper.WaterDetailsMapper;
import com.hbue.water.service.WaterDetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author yushu
 * @date 2021/12/26
 * @apiNate
 */
@Service
public class WaterDetailsServiceImpl implements WaterDetailsService {

    @Autowired
    private WaterDetailsMapper waterDetailsMapper;

    @Override
    public PageInfo<WaterDetails> listWater(int pageNum, int pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        List<WaterDetails> waterDetails = this.querySendWaterDetails();
        return new PageInfo<>(waterDetails);
    }

    /**
     * 查询每个送水工送水的详细信息
     * @return 送水详细信息列表
     */
    @Override
    public List<WaterDetails> querySendWaterDetails() {
        return waterDetailsMapper.querySendWaterDetails();
    }
}
